<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/common.jspf" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>登录页</title>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" type="text/css" href="${base }/css/common.css" />
		<link rel="stylesheet" type="text/css" href="${base }/js/plugins/formValidator/validator.css" />
		<script type="text/javascript" src="${base }/js/jquery-1.7.min.js"></script>
		<script type="text/javascript" src="${base }/js/plugins/formValidator/formValidatorRegex.js"></script>
		<script type="text/javascript" src="${base }/js/plugins/formValidator/formValidator.js"></script>
		<script type="text/javascript">
			$(document).ready(function() {
				$.formValidator.initConfig({
					formID:'_loginForm',
					debug:false,
					submitOnce:true,
					onError:function(msg,obj,errorlist){
						alert(msg);
					}
				});
				$("#regname").formValidator({onShow:"请输入用户名",onFocus:"用户名至少1个字符"}).inputValidator({min:1,onError:"用户名不能为空"});
				$("#password").formValidator({onShow:"请输入密码",onFocus:"至少1个字符"}).inputValidator({min:1,empty:{leftEmpty:false,rightEmpty:false,emptyError:"密码两边不能有空符号"},onError:"密码不能为空"});
			});
		</script>
	</head>

	<body>
		<center><h2>用户登陆</h2></center>
		<form action="${base }/user_login" id="_loginForm" method="post" class="login">
			<table>
        		<tr>
        			<td width="50">用户名：</td>
        			<td><input type="text" name="regname" id="regname" class="text-input" /></td>
        			<td><div id="regnameTip" style="width:200px"></div></td>
        		</tr>
				<tr>
        			<td>密码：</td>
        			<td><input type="password" name="password" id="password" class="text-input" /></td>
        			<td><div id="passwordTip" style="width:200px"></div></td>
        		</tr>
        		<tr>
        			<td colspan="3" align="center">
        				<input value="登陆" type="submit" />
        				<input type="reset" value="重填" />
        				<input type="button" value="注册新用户" onclick="javascript:window.location.href='${base }/user_register';" />
        			</td>
        		</tr>
        		<tr>
        			<td colspan="3" class="required">${message }</td>
        		</tr>
        	</table>
		</form>
	</body>
</html>